//Firefox profiles

import java.io.File;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.ini4j.Profile;
import org.junit.*;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
import org.openqa.selenium.support.ui.Select;

public class yahooregistration {
	WebDriver driver = new FirefoxDriver();
	String vURL = "https://in.edit.yahoo.com";
	
	@Test
	public void yahooregistration() throws Exception{
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
		driver.get(vURL);  
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

		driver.get(vURL + "/registration?.pd=ym_ver%253D0%2526c%253D%2526ivt%253D%2526sg%253D&intl=in&origIntl=&done=http%3A%2F%2Fmail.yahoo.com&src=ym&wl=&wlcr=&create_alias=&.scrumb=&last=&partner=yahoo_default&domain=&yahooid=&lang=en-IN");
	    driver.findElement(By.id("first-name")).clear();
	    driver.findElement(By.id("first-name")).sendKeys("Maruthi");
	    driver.findElement(By.id("last-name")).clear();
	    driver.findElement(By.id("last-name")).sendKeys("Ram");
	    driver.findElement(By.id("user-name")).clear();
	    driver.findElement(By.id("user-name")).sendKeys("pmaruthiram82");
	    driver.findElement(By.id("password")).clear();
	    driver.findElement(By.id("password")).sendKeys("Maruth1ram");
	    driver.findElement(By.id("password")).sendKeys(Keys.TAB);
	    Thread.sleep(2000);
	    driver.findElement(By.cssSelector("div.arrow-container > div.bottom-dd-arrow")).click();
	    Thread.sleep(2000);
	   // Select sele = new Select(driver.findElement(By.id("arrow-container"))); 
	    //sele.selectByIndex(193);
	    driver.findElement(By.partialLinkText("India (+91)")).click();
	    driver.findElement(By.id("mobile")).clear();
	    driver.findElement(By.id("mobile")).sendKeys("9949906130");
	    
}
}
